/**
 * Created by bai on 2015-10-30.
 */
var controller = angular.module('controller',[]);

controller.controller('serviceList',function($scope,$location,TransmissionData,BACK){
    var serviceList=[
        {table:"1号桌",service:'餐巾纸',time:'12:10'},
        {table:"2号桌",service:'酒水',time:'15:30'},
        {table:"3号桌",service:'要茶水',time:'11:00'}
    ]
    $scope.items = serviceList;
    $scope.serviceInfo=function(item){
        TransmissionData.info=item;
        BACK.backStore($location.path(),'memberList');
    }

});

/*
* 会员列表的控制器
* */
controller.controller('memberList',function($scope,$location,TransmissionData,BACK){
    var data= {"data":[{"_id":{"$id":"563024977afdb10c03577e0a"},"memberName":"郭大鹏","memberMobile":"15232400871","number":"007","level":1,"channel":"","memberMemo":"","status":"active","balance":0,"memberTranlist":[],"MyTokenList":[],"historyAddress":[],"id":"563024977afdb10c03577e0a","_deleted":false,"time":{"sec":1445995671,"usec":145000},"_v":0},{"_id":{"$id":"5632e9597afdb17516798a69"},"memberName":"白庆春","memberMobile":"1564879763","number":"","level":1,"channel":"","memberMemo":"啊读书法","status":"active","balance":0,"memberTranlist":[],"MyTokenList":[],"historyAddress":[],"id":"5632e9597afdb17516798a69","_deleted":false,"time":{"sec":1446177113,"usec":466000},"_v":0},{"_id":{"$id":"5632e9667afdb17217810d1b"},"memberName":"董磊","memberMobile":"154645448","number":"","level":1,"channel":"","memberMemo":"","status":"active","balance":0,"memberTranlist":[],"MyTokenList":[],"historyAddress":[],"id":"5632e9667afdb17217810d1b","_deleted":false,"time":{"sec":1446177126,"usec":183000},"_v":0}],"error":0,"errmsg":[],"cookieData":[]}
    $scope.items=SortOut.memberList(data.data);
    console.log( $scope.items)
    $scope.memberInfo= function(item){
        TransmissionData.info=item;
        BACK.backStore($location.path(),'memberInfo');
    }
});
/*
* 会员详情
* */
controller.controller('memberInfo',function($scope,TransmissionData,OrderingSystem){
    $scope.item=  TransmissionData.info
    $scope.get = function(){
        var options={};
        options.data=[1,22,3,4];
        options.successFunction = function(data){
            alert(JSON.stringify(data));
        }
        OrderingSystem.getMemberList(options)
    }


})